package org.example.cicdi.enums;

import org.apache.commons.codec.binary.StringUtils;

public enum EnumWhiteTableAnnotation {
 
    WebModel(1, "WebModel"),

    TableDomain(2, "TableDomain"),
    ;

    /**
     * 类型 1/单表 2/一对多 3/树
     */
	Integer type;
	
	/**
     * 编码标识
     */
    String code;

    EnumWhiteTableAnnotation(Integer type, String code) {
        this.type = type;
        this.code = code;
    }
    
    public static EnumWhiteTableAnnotation getByCode(String code) {
    	for (EnumWhiteTableAnnotation en : EnumWhiteTableAnnotation.values()) {
    		if (StringUtils.equals(en.getCode(), code)) {
    			return en;
    		}
    	}
    	
    	return null;
    }

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
}
